0 CpxTRS
↳1 TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID), 0 ms)
↳2 CpxWeightedTrs
↳3 TypeInferenceProof (BOTH BOUNDS(ID, ID), 2 ms)
↳4 CpxTypedWeightedTrs
↳5 CompletionProof (UPPER BOUND(ID), 0 ms)
↳6 CpxTypedWeightedCompleteTrs
↳7 CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID), 0 ms)
↳8 CpxRNTS
↳9 CompleteCoflocoProof (⇔, 166 ms)
↳10 BOUNDS(1, 1)
f(g(i(a, b, b'), c), d) → if(e, f(.(b, c), d'), f(.(b', c), d'))
f(g(h(a, b), c), d) → if(e, f(.(b, g(h(a, b), c)), d), f(c, d'))
f(g(i(a, b, b'), c), d) → if(e, f(.(b, c), d'), f(.(b', c), d')) [1]
f(g(h(a, b), c), d) → if(e, f(.(b, g(h(a, b), c)), d), f(c, d')) [1]
f(g(i(a, b, b'), c), d) → if(e, f(.(b, c), d'), f(.(b', c), d')) [1]
f(g(h(a, b), c), d) → if(e, f(.(b, g(h(a, b), c)), d), f(c, d')) [1]
f :: c:g:. → d:d' → if g :: i:h → c:g:. → c:g:. i :: a → b:b' → b:b' → i:h a :: a b :: b:b' b' :: b:b' c :: c:g:. d :: d:d' if :: e → if → if → if e :: e . :: b:b' → c:g:. → c:g:. d' :: d:d' h :: a → b:b' → i:h |
f(v0, v1) → null_f [0]
null_f, const
Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules:
The TRS has the following type information:
Rewrite Strategy: INNERMOST |
a => 0
b => 0
b' => 1
c => 0
d => 0
e => 0
d' => 1
null_f => 0
const => 0
f(z, z') -{ 0 }→ 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1
f(z, z') -{ 1 }→ 1 + 0 + f(1 + 0 + 0, 1) + f(1 + 1 + 0, 1) :|: z = 1 + (1 + 0 + 0 + 1) + 0, z' = 0
f(z, z') -{ 1 }→ 1 + 0 + f(1 + 0 + (1 + (1 + 0 + 0) + 0), 0) + f(0, 1) :|: z = 1 + (1 + 0 + 0) + 0, z' = 0
eq(start(V, V1),0,[f(V, V1, Out)],[V >= 0,V1 >= 0]). eq(f(V, V1, Out),1,[f(1 + 0 + 0, 1, Ret01),f(1 + 1 + 0, 1, Ret1)],[Out = 1 + Ret01 + Ret1,V = 3,V1 = 0]). eq(f(V, V1, Out),1,[f(1 + 0 + (1 + (1 + 0 + 0) + 0), 0, Ret011),f(0, 1, Ret11)],[Out = 1 + Ret011 + Ret11,V = 2,V1 = 0]). eq(f(V, V1, Out),0,[],[Out = 0,V2 >= 0,V3 >= 0,V = V2,V1 = V3]). input_output_vars(f(V,V1,Out),[V,V1],[Out]). |
CoFloCo proof output:
Preprocessing Cost Relations
=====================================
#### Computed strongly connected components
0. recursive [multiple] : [f/3]
1. non_recursive : [start/2]
#### Obtained direct recursion through partial evaluation
0. SCC is partially evaluated into f/3
1. SCC is partially evaluated into start/2
Control-Flow Refinement of Cost Relations
=====================================
### Specialization of cost equations f/3
* CE 5 is refined into CE [6]
* CE 3 is refined into CE [7]
* CE 4 is refined into CE [8]
### Cost equations --> "Loop" of f/3
* CEs [7] --> Loop 5
* CEs [8] --> Loop 6
* CEs [6] --> Loop 7
### Ranking functions of CR f(V,V1,Out)
#### Partial ranking functions of CR f(V,V1,Out)
### Specialization of cost equations start/2
* CE 2 is refined into CE [9,10,11]
### Cost equations --> "Loop" of start/2
* CEs [10] --> Loop 8
* CEs [9,11] --> Loop 9
### Ranking functions of CR start(V,V1)
#### Partial ranking functions of CR start(V,V1)
Computing Bounds
=====================================
#### Cost of chains of f(V,V1,Out):
* Chain [7]: 0
with precondition: [Out=0,V>=0,V1>=0]
* Chain [multiple(6,[[7],[multiple(5,[[7]])]])]: 3
with precondition: [V=2,V1=0,2>=Out,Out>=1]
* Chain [multiple(5,[[7]])]: 1
with precondition: [V=3,V1=0,Out=1]
#### Cost of chains of start(V,V1):
* Chain [9]: 3
with precondition: [V>=0,V1>=0]
* Chain [8]: 1
with precondition: [V=3,V1=0]
Closed-form bounds of start(V,V1):
-------------------------------------
* Chain [9] with precondition: [V>=0,V1>=0]
- Upper bound: 3
- Complexity: constant
* Chain [8] with precondition: [V=3,V1=0]
- Upper bound: 1
- Complexity: constant
### Maximum cost of start(V,V1): 3
Asymptotic class: constant
* Total analysis performed in 82 ms.